package io.nads.controller;


import io.nads.dto.Result;
import io.nads.service.ChatService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/chat")
public class ChatController {
    @Autowired
    private ChatService chatService;

    /**
     * 获取当前Chat session中所有的会话历史，并切换上下文
     * @param chatSessionId
     * @return
     */
    @GetMapping("/{chatSessionId}")
    public Result getAllChatMessagesAndSwitch(@PathVariable Long chatSessionId) {
        return chatService.getAllChatMessagesAndSwitch(chatSessionId);
    }
}
